<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
	<link type="text/css" rel="stylesheet" href="./css/manage/style.css">
	<script type="text/javascript" src="<%=basePath%>/script/jquery-1.6.2.min.js"></script>
	<style type="text/css">
	.red { color: red; text-align: left; }
	</style>
  </head>
  
  <body>
  	
  		<s:form action="/cas/types_updateorsave.action" id="types_updateorsave" method="post">
    	<table width="100%" class="tab_comm">
    			<s:token/>
				
				<tbody>
					<tr>
						<td class="tr fb blue_s">名称:</td>
						<td><s:textfield id="name" name="type.name" cssClass="name_text" maxlength="75"/><span class="red" style="">*</span></td>
					</tr>
					<tr>
						<td class="tr fb blue_s">编号:</td>
						<td><s:textfield id="typecode" name="type.typecode" cssClass="name_text" maxlength="75"/></td>
					</tr>
					<tr>
						<td class="tr fb blue_s">内置类型:</td>
						<td><s:select  id="dtype" name="type.dtype" list="#request.dtypesList" listKey="key" listValue="value"/></td>
					</tr>
					<tr>
						<td  class="tr fb blue_s">自动判分:</td>
						<td><s:select name="type.auto" list="#{'1':'是','0':'否'}"/></td>
					</tr>
					<tr>
						<td  class="tr fb blue_s">复合题:</td>
						<td><s:select name="type.mixed" list="#{'1':'是','0':'否'}"/></td>
					</tr>
					<tr>
						<td  class="tr fb blue_s">状态:</td>
						<td><s:select name="type.status" list="#{'1':'启用','0':'停用'}"/></td>
					</tr>
					<tr>
						<td colspan="2">
						<span class="btnC"><input type="button" value="保存" class="btnC_text" onclick="_submit()"/></span>
						<span class="btnC"><input type="button" value="取消" class="btnC_text" onclick="javascript:window.location.href='./cas/types_index.action'" /></span>
						</td>
					</tr>
				</tbody>
		</s:form>
    
  </body>
  <script type="text/javascript">
  		function _submit(){
  			var name=jQuery("#name").val();
  			if(name==""){
  				alert("名称不能空！");
  				return false;
  			}
  			document.types_updateorsave.submit();
  		}
  </script>

</html>